package itsm.isperp.module.controller.configuration;

import itsm.isperp.framework.data.domain.PageResponse;
import itsm.isperp.framework.web.controller.BaseController;
import itsm.isperp.framework.web.request.JqGridFilterRuleOp;
import itsm.isperp.framework.web.request.JqGridRequest;
import itsm.isperp.module.entity.configuration.ConfCiRelationUsePropety;
import itsm.isperp.module.service.configuration.ConfCiRelationUsePropetyService;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 配置关系控制器
 * 
 * @author lizx
 * @date 2014-09-23 16:24
 */
@Controller
@RequestMapping("configuration/ciRelationUsePropety")
public class ConfCiRelationUsePropetyController extends
		BaseController<ConfCiRelationUsePropety> {

	@Autowired
	protected ConfCiRelationUsePropetyService confCiRelationUsePropetyService;

	@Override
	public ConfCiRelationUsePropetyService getService() {
		return this.confCiRelationUsePropetyService;
	}

	@Override
	public String getPageTitle() {
		return "配置关系";
	}

	@RequestMapping("listDetail")
	@ResponseBody
	@Override
	public PageResponse<Map<String, Object>> listDetail(JqGridRequest request,
			HttpServletRequest req) {
		String relationTypeId = req.getParameter("relationTypeId");

		request.addFilterRule("relationTypeId", JqGridFilterRuleOp.eq,
				relationTypeId);

		return this.getService().findAllDetailByRequest(request).toPage();

	}
}
